﻿<%@ Page Title="User Management - Add - Edit" Language="C#" MasterPageFile="~/admin.master"
    AutoEventWireup="true" Inherits="MediaMonitor.Admin.editRole" Theme="default"
    CodeBehind="editRole.aspx.cs" %>

<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>

<asp:Content ID="Content1" ContentPlaceHolderID="Head" runat="Server">
    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
        <script src="../rad-scripts/rad.js" type="text/javascript"></script>
    </telerik:RadCodeBlock>
 </asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="Body" runat="Server">
     
   <telerik:RadAjaxPanel ID="pnlUpdate" runat="server" RestoreOriginalRenderDelegate="false">
         
            <asp:HiddenField ID="hdnFormMode" runat="server" Value="add" />
            <asp:HiddenField ID="hdnCurPkId" runat="server" Value="0" />
            <asp:HiddenField ID="hdnCurCId" runat="server" Value="0" />

            <asp:Panel ID="pnlIno" runat="server" Visible="false">
                <asp:Label ID="lblMsg" runat="server" SkinID="Error" />
                <br />
                <br />
                <ul>
                    <li><a class="BigLink" href="ChangeRole.aspx">List of All Users</a></li> 
                    
                    <%--<li><a class="BigLink" href='user-mgmt-list.aspx?cid=<%=Request["cid"]%>'>List of All
                        Users of this same Client</a></li>
                    <li><a class="BigLink" href='user-mgmt-addedit.aspx?cid=<%=Request["cid"]%>'>Add New User of same Client</a></li>--%>
                </ul>
            </asp:Panel>

            <asp:Panel ID="pnlForm" runat="server">
                <table width="95%">
                    <tr>
                        <td colspan="4">
                            <asp:Label ID="lblMsg_top" runat="server" SkinID="Error" />
                        </td>
                    </tr>
                    <tr>
                        <td>
                        </td>
                        <td colspan="3">
                         
                            <asp:ImageButton ID="btnUpdate_top" runat="server" SkinID="Update" OnClick="btnUpdate_Click"
                                ValidationGroup="form" />
                         
                            <asp:ImageButton ID="btnCancel_top" runat="server" SkinID="Cancel" OnClick="btnCancel_Click"
                                CausesValidation="false" />
                            <br />
                        </td>
                    </tr>
                    <tr>
                        <td colspan="4">
                            <asp:ValidationSummary ID="vSummary" runat="server" ValidationGroup="form" />
                        </td>
                    </tr>
                    

                    <tr>

                        <td>
                            <b>User Login Name</b>
                        </td>
                        <td>
                            <asp:TextBox ID="tbLoginName" runat="server" ValidationGroup="form" />
                            <asp:RequiredFieldValidator ID="rfvLogin" runat="server" ControlToValidate="tbLoginName"
                                ErrorMessage="Plz Enter a Login Name" Text="*" Display="Dynamic" ValidationGroup="form" />
                            <asp:RegularExpressionValidator ID="revLoginNae" runat="server" ControlToValidate="tbLoginName"
                                Display="Dynamic" ValidationGroup="form" Text="Invalid login name" ErrorMessage="Login name rule: All small letters, alpha numeric text without spaces.&nbsp; &#39;-&#39; &amp; &#39;_&#39; are allowed. Minimum 2 letters, maximum 50 letters" ValidationExpression="\b[a-z0-9_-]{2,50}\b"></asp:RegularExpressionValidator>
                        </td>
                     
                        
                    </tr>
                    <tr>
                        <td>
                            <b>Role Name </b>
                        </td>
                        <td colspan="3">
                            <asp:DropDownList ID="lstCompany" runat="server" 
                                DataTextField="RoleName"  AutoPostBack="true" CausesValidation="false"
                                DataValueField="RoleId" 
                                ValidationGroup="form" />
                            
                            <asp:RequiredFieldValidator ID="rfvCompName" runat="server" ControlToValidate="lstCompany"
                                ErrorMessage="Company Name required" Text="*" Display="Dynamic" ValidationGroup="form" InitialValue="0" />
                            
                           

                        </td>
                    </tr>
                  
                   
                    
                    <tr>
                        <td>
                        </td>
                        <td colspan="3">
                            <br />
                           
                            <asp:ImageButton ID="btnUpdate" runat="server" SkinID="Update" OnClick="btnUpdate_Click"
                                ValidationGroup="form" />
                           
                            <asp:ImageButton ID="btnCancel" runat="server" SkinID="Cancel" OnClick="btnCancel_Click"
                                CausesValidation="false" />
                        </td>
                    </tr>
                </table>
            </asp:Panel>


   </telerik:RadAjaxPanel>

   

    <asp:SqlDataSource ID="sqlDSComp" runat="server"  ConnectionString='<%$ ConnectionStrings:DBAdex%>' SelectCommand="SELECT RoleId, RoleName FROM aspnet_Roles ORDER BY RoleName">
    </asp:SqlDataSource>
</asp:Content>
